home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7502 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: cpsc.ucalgary.ca!parker
  2. From: parker@cpsc.ucalgary.ca (Jim Parker)
  3. Newsgroups: comp.lang.c,comp.lang.pl1
  4. Subject: Re: GOTO controversy
  5. Date: 27 Feb 1996 02:33:22 GMT
  6. Organization: University of Calgary CPSC
  7. Message-ID: <4gtqhi$r8q@linux.cpsc.ucalgary.ca>
  8. References: <rcshlds.1.000A6705@mailserv.mta.ca> <Dn8pJ8.nqs@emi.net> <4grt4e$8fg@goanna.cs.rmit.EDU.AU>
  9. NNTP-Posting-Host: albert.cpsc.ucalgary.ca
  10.  
  11. In article <4grt4e$8fg@goanna.cs.rmit.EDU.AU>,
  12. >    >Robert C Shields (rcshlds@mailserv.mta.ca) wrote:
  13. >
  14. >Is there any reason why the GOTOs can't be replaced by
  15. >the particular action routine?
  16. >
  17. Yup. Clearly, if malloc fails we have 5 calls to clean up; each
  18. successive error needs fewer cleanup calls.
  19.  
  20. I have encountered the same thing with simple files, and with
  21. allocation of complex linked structures. It is almost always
  22. true that GOTOs are misused, but not exclusively, and there are
  23. places where it cleans things up a bit.
  24.  
  25. >It makes it clumsy to read such code.
  26.  
  27. Not if it is all on the same page.
  28.  
  29.  
  30. -- 
  31. Jim Parker            parker@cpsc.ucalgary.ca
  32. Laboratory for Computer Vision
  33. Department of Computer Science                  403-220-6784
  34. University of Calgary                           403-284-4707 (FAX)
  35.